//
//  FSInfiniteBanner.h
//  Qianyilc
//
//  Created by DingWenchao on 6/5/15.
//  Copyright (c) 2015 lianchu. All rights reserved.
//

#import <UIKit/UIKit.h>

@class FSBannerView;

@protocol FSBannerViewDataSource <NSObject>
- (NSInteger)numberOfItemsInBannerView:(FSBannerView *)bannerView;
- (NSURL *)bannerView:(FSBannerView *)bannerView imageURLAtIndex:(NSInteger)index;
- (NSString *)bannerView:(FSBannerView *)bannerView imageNameAtIndex:(NSInteger )index;
@end

@protocol FSBannerViewDelegate <NSObject>
@optional
- (void)bannerView:(FSBannerView *)bannerView didSelectItemAtIndex:(NSInteger)index;
@end

typedef NS_ENUM(NSInteger, FSBannerPageIndicatorAlignment) {
    FSBannerPageIndicatorAlignmentLeft   = 0,
    FSBannerPageIndicatorAlignmentCenter = 1,
    FSBannerPageIndicatorAlignmentRight  = 2
};

IB_DESIGNABLE
@interface FSBannerView : UIView

/**
* 滑屏间隔
*/
@property (assign, nonatomic) IBInspectable CGFloat flippingInterval;

/**
 * 无限循环
 */
@property (assign, nonatomic) IBInspectable BOOL infinite;

/**
 * 展示分页符
 */
@property (assign, nonatomic) IBInspectable BOOL showsPageIndicator;

/**
 * 占位图
 */
@property (strong, nonatomic) IBInspectable UIImage *placeholderImage;

/**
 * 位置
 */
@property (assign, nonatomic) FSBannerPageIndicatorAlignment pageIndicatorAlignment;

/**
 *  分页符缺省颜色
 */
@property (strong, nonatomic) UIColor *pageIndicatorTintColor;

/**
 *  分页符展示颜色
 */
@property (strong, nonatomic) UIColor *currentPageIndicatorTintColor;


@property (weak, nonatomic) id<FSBannerViewDataSource> dataSource;
@property (weak, nonatomic) id<FSBannerViewDelegate  > delegate;

- (void)reloadData;

@end







@interface FSBannerViewCell : UICollectionViewCell

@property (weak, nonatomic) UIImageView *imageView;
@property (weak, nonatomic) UIView *overlay;

@end
